package epam.bank.api.repository;

import epam.bank.api.domain.Persistent;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: dima
 * Date: 09.03.13
 * Time: 20:45
 * To change this template use File | Settings | File Templates.
 */
public interface IGenericCRUDRepository<T extends Persistent> {

    public T save(T entity) throws IllegalArgumentException;

    public void delEntity(Long id) throws IllegalArgumentException;
    public void delEntity(T entity) throws IllegalArgumentException;

    public T getEntityById(Long id) throws IllegalArgumentException;
    public List<T> getAllEntities();

    public long getAllEntitiesCount();

    public List<T> getAllSorted(String propertySortBy, boolean asc) throws IllegalArgumentException;
}
